{% extends "base.html" %}
{% load cache i18n tagging_tags tagging_related %}

{% block title %}{{ object.title }} | {{ block.super }}{% endblock %}

{% block content %}

{% cache 180 "quote.quote_detail" object.pk %}
<div class="quote clearfix">
    <h2>{{ object.title }}</h2>

    <div class="body">
        {% if object.quote %}
        <blockquote cite="{{ object.url_source }}">{{ object.quote }}</blockquote>
        {% endif %}
    </div>

    <div class="source">
        {% if object.author %}
        {% if object.url_source %}
        <span>&mdash; <a href="{{ object.url_source }}">{{ object.author }}</a></span>
        {% else %}
        <span>- {{ object.author }} {% if object.circa %}, {{ object.circa }}{% endif %}</span>
        {% endif %}
        {% endif %}
    </div>

    {% cache 1800 "quote.quote_detail.tag_list" object.pk %}
    {% tags_for_object object as tag_list %}
    {% if tag_list %}
    <div class="tags">
        <strong>{% trans "Tags" %}:</strong>
        <ul class="tag inline">
            {% for tag in tag_list %}
            <li><a href="/tags/{{ tag }}">{{ tag }}</a></li>
            {% endfor %}
        </ul>
    </div>
    {% endif %}
    {% endcache %}

    {% cache 1800 "quoteme.quote_detail.related_list" object.pk %}
    {% tagged_get_related object in quoteme.Quote as quote_list with num=3 %}
    {% if quote_list %}
    <div class="related">
        <strong>{% trans "Related quotes" %}:</strong>
        <ol class="quote inline">
            {% for quote in quote_list %}
            <li><a href="{{ quote.get_absolute_url }}">{{ quote.title }}</a></li>
            {% endfor %}
        </ol>
    </div>
    {% endif %}
    {% endcache %}

</div>
{% endcache %}

{% include "blog/includes/comments.html" %}

{% endblock %}
